import ajax from './index'

export function jd_group() {
  return ajax({
    url: "/pms/jd/groups",
    method: "get"
  });
}

export function jd_goods_list(group_id, condition) {
  if (!condition) {
    condition = {
      offset: 0,
      pageSize: 100
    }
  }
  return ajax({
    url: "/pms/jd/list/" + (group_id || 0),
    method: "get",
    params: condition
  });
}
export function jd_province() {
  return ajax({
    url: "/pms/jd/province_list",
    method: "get"
  });
}
export function jd_city(id) {
  return ajax({
    url: "/pms/jd/city_list/" + id,
    method: "get"
  });
}
export function jd_county(id) {
  return ajax({
    url: "/pms/jd/county_list/" + id,
    method: "get"
  });
}
export function jd_town(id) {
  return ajax({
    url: "/pms/jd/town_list/" + id,
    method: "get"
  });
}
export function jd_edit_address(param) {
  return ajax({
    url: "/pms/order/editJdAddress",
    method: "post",
    data: param
  });
}
export function jd_create_order(id) {
  return ajax({
    url: "/pms/order/createJdOrder/" + id,
    method: "post"
  });
}
